package com.unicom.office.type;

import com.unicom.office.var.NumberVarItem;
import com.unicom.office.var.VarItem;

public class NumberTypeItem extends DataTypeItem {
    private NumberTypeItem(String name) {
        super(name);
    }

    public VarItem createVarItem(String name) {
        return new NumberVarItem(name);
    }

    public Object getFormatedValue(Object value) {
        if(value instanceof String) {
            return Double.valueOf(value.toString());
        }
        return value;
    }

    public static NumberTypeItem INSTANCE = new NumberTypeItem("number");
}
